//
//  ShopMseeageModel.swift
//  Pods
//
//  Created by eme on 2017/3/28.
//
//

import Foundation
import SwiftyJSON
import ModelProtocol

class ShopMseeageModel: ModelProtocol {
    
    // MARK: Declaration for string constants to be used to decode and also serialize.
    internal let kShopMseeageSpcontactKey: String = "spcontact"
    internal let kShopMseeageAgprovincenameKey: String = "agprovincename"
    internal let kShopMseeageSplicenseKey: String = "splicense"
    internal let kShopMseeageSpstateKey: String = "spstate"
    internal let kShopMseeageSpcompanyKey: String = "spcompany"
    internal let kShopMseeageSpareacodeKey: String = "spareacode"
    internal let kShopMseeageSpcodeKey: String = "spcode"
    internal let kShopMseeageAginvitecodeKey: String = "aginvitecode"
    internal let kShopMseeageSpidKey: String = "spid"
    internal let kShopMseeageSpinvoiceKey: String = "spinvoice"
    internal let kShopMseeageAgareanameKey: String = "agareaname"
    internal let kShopMseeageAgprovincecodeKey: String = "agprovincecode"
    internal let kShopMseeageUseridKey: String = "userid"
    internal let kShopMseeageSpaddressKey: String = "spaddress"
    internal let kShopMseeageSpregdateKey: String = "spregdate"
    internal let kShopMseeageSpmobileKey: String = "spmobile"
    internal let kShopMseeagePasswordKey: String = "password"
    internal let kShopMseeageSpareanameKey: String = "spareaname"
    internal let kShopMseeageSpnameKey: String = "spname"
    internal let kShopMseeageSplicenseurlKey: String = "splicenseurl"
    internal let kShopMseeageAgareacodeKey: String = "agareacode"
    
    
    // MARK: 属性
    var spcontact: String
    var agprovincename: String
    var splicense: String
    var spstate: String
    var spcompany: String
    var spareacode: String
    var spcode: String
    var aginvitecode: String
    var spid: String
    var spinvoice: String
    var agareaname: String
    var agprovincecode: String
    var userid: Int
    var spaddress: String
    var spregdate: String
    var spmobile: String
    var password: String
    var spareaname: String
    var spname: String
    var splicenseurl: String
    var agareacode: String
    var auditremark:String
    
    
    // MARK: 实现MikerSwiftJSONAble 协议， 解析json数据
    required  init?(json: JSON) {
        spcontact = json[kShopMseeageSpcontactKey].stringValue
        agprovincename = json[kShopMseeageAgprovincenameKey].stringValue
        splicense = json[kShopMseeageSplicenseKey].stringValue
        spstate = json[kShopMseeageSpstateKey].stringValue
        spcompany = json[kShopMseeageSpcompanyKey].stringValue
        spareacode = json[kShopMseeageSpareacodeKey].stringValue
        spcode = json[kShopMseeageSpcodeKey].stringValue
        aginvitecode = json[kShopMseeageAginvitecodeKey].stringValue
        spid = json[kShopMseeageSpidKey].stringValue
        spinvoice = json[kShopMseeageSpinvoiceKey].stringValue
        agareaname = json[kShopMseeageAgareanameKey].stringValue
        agprovincecode = json[kShopMseeageAgprovincecodeKey].stringValue
        userid = json[kShopMseeageUseridKey].intValue
        spaddress = json[kShopMseeageSpaddressKey].stringValue
        spregdate = json[kShopMseeageSpregdateKey].stringValue
        spmobile = json[kShopMseeageSpmobileKey].stringValue
        password = json[kShopMseeagePasswordKey].stringValue
        spareaname = json[kShopMseeageSpareanameKey].stringValue
        spname = json[kShopMseeageSpnameKey].stringValue
        splicenseurl = json[kShopMseeageSplicenseurlKey].stringValue
        agareacode = json[kShopMseeageAgareacodeKey].stringValue
        auditremark = json["auditremark"].stringValue
        
    }
    
    
    /**
     Generates description of the object in the form of a NSDictionary.
     - returns: A Key value pair containing all valid values in the object.
     */
    internal func dictionaryRepresentation() -> [String : AnyObject ] {
        
        var dictionary: [String : AnyObject ] = [ : ]
        
        dictionary.updateValue(spcontact as AnyObject, forKey: kShopMseeageSpcontactKey)
    
    
        dictionary.updateValue(agprovincename as AnyObject, forKey: kShopMseeageAgprovincenameKey)
    
    
        dictionary.updateValue(splicense as AnyObject, forKey: kShopMseeageSplicenseKey)
    
    
        dictionary.updateValue(spstate as AnyObject, forKey: kShopMseeageSpstateKey)
    
    
        dictionary.updateValue(spcompany as AnyObject, forKey: kShopMseeageSpcompanyKey)
    
    
        dictionary.updateValue(spareacode as AnyObject, forKey: kShopMseeageSpareacodeKey)
    
   
        dictionary.updateValue(spcode as AnyObject, forKey: kShopMseeageSpcodeKey)
    
    
        dictionary.updateValue(aginvitecode as AnyObject, forKey: kShopMseeageAginvitecodeKey)
    
    
        dictionary.updateValue(spid as AnyObject, forKey: kShopMseeageSpidKey)
    
    
        dictionary.updateValue(spinvoice as AnyObject, forKey: kShopMseeageSpinvoiceKey)
    
    
        dictionary.updateValue(agareaname as AnyObject, forKey: kShopMseeageAgareanameKey)
    
    
        dictionary.updateValue(agprovincecode as AnyObject, forKey: kShopMseeageAgprovincecodeKey)
    
    
        dictionary.updateValue(userid as AnyObject, forKey: kShopMseeageUseridKey)
    

        dictionary.updateValue(spaddress as AnyObject, forKey: kShopMseeageSpaddressKey)
    
    
        dictionary.updateValue(spregdate as AnyObject, forKey: kShopMseeageSpregdateKey)
    
        dictionary.updateValue(spmobile as AnyObject, forKey: kShopMseeageSpmobileKey)
    
    
        dictionary.updateValue(password as AnyObject, forKey: kShopMseeagePasswordKey)
    
    
        dictionary.updateValue(spareaname as AnyObject, forKey: kShopMseeageSpareanameKey)
    
    
        dictionary.updateValue(spname as AnyObject, forKey: kShopMseeageSpnameKey)
    
    
        dictionary.updateValue(splicenseurl as AnyObject, forKey: kShopMseeageSplicenseurlKey)
    
    
        dictionary.updateValue(agareacode as AnyObject, forKey: kShopMseeageAgareacodeKey)
        
        dictionary.updateValue(auditremark as AnyObject, forKey: "auditremark")
        return dictionary
    }
    
    
}
